var tpl = require('../../views/message/messageDetail');
var request = require('request');
var template = require('template');
var router = require('router');

return extend('./main', {
    path:'/message/:id',
    wrapper:true,
    level:0,
    events:{
        'click .j-back':'back'
    },
    onInit:function(){
        var elem = this.element.find('.m-message-body');
        request.get('user.json', this.data.params, {
            200:function(res){
                elem.html(template.render(tpl, res.data))
            }
        })
    },
    back:function(){
        router.location(this.data.path, false)
    }
})